class Track < ActiveRecord::Base


  # revert the object to a given revision number

  def restore
    rec = ActiveRecord::Base.const_get(trackable_type).restore_from_xml(record_data, :id => trackable_id)
    rec.id= trackable_id
    ActiveRecord::Base.const_get(trackable_type).without_tracking do
      rec.version = self.version
      saved = rec.save
    end
    return rec if rec && saved
    raise "There was an error restoring the #{model} from DeletedRecord(#{id})"
  end

end